<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <title></title>
    <link rel="stylesheet" href="Css/m_new.css">
    <link rel="stylesheet" href="Css/m.css">
    <script>
        var _web_base = "http://t.flowerplus.cn/".replace(/^https?:/, window.location.protocol);
        document.domain = "flowerplus.cn";
    </script>
    <link rel="stylesheet" type="text/css" href="Css/reset.css">
    <link rel="stylesheet" type="text/css" href="Css/global.css">
    <link rel="stylesheet" href="Css/weui.css">
    <link rel="stylesheet" href="Css/jquery-weui.css">
    <script src="Scripts/jquery-2.1.4.js"></script>
    <script src="Scripts/jquery-weui.js"></script>
    <script src="Scripts/jweixin-1.2.0.js"></script>
    <script src="Scripts/m.js"></script>
    <script src="Scripts/http.js"></script>

    <meta name="mobile-agent" content="format=html5; url=http://m.flowerplus.cn/f20469">
    <link rel='canonical' href='http://www.flowerplus.cn/f20469'/>
    <link rel="stylesheet" type="text/css" href="Css/product.css">
    <!-- <link rel="stylesheet" type="text/css" href="Css/global.css"> -->
    <style>
        .disable {
            color: #cccccc !important;
        }

        #sever-time > label {
            display: block;
            width: 40%;
            float: left;
            border: 1px solid #e5e5e5;
            text-align: center;
            margin: 18px 5px 5px 10px;
        }
        .sku-item>dd>select{
            border-color:#e5e5e5;
            margin-left: 10px;
        }
        .sku-item>dd>label{
            margin-right:10px;
        }
        .sku-item>dd>label{
            display: block;
            border: 1px solid #e5e5e5;
            width: 70px;
            text-align: center;
        }
        .xqy{
            position: absolute;
            margin-left:10px;
        }
        .xqw{
            position: absolute;
            margin-left: 100px;
        }
        .choiceTime{
            margin-right: 50px;
        }
        #didian2>dd>input{
            border:1px solid #e5e5e5;
            padding:7px 0px;
            border-radius: 5%;
            padding-left:5px;
            margin-top: 5px;
        }
    </style>
    <!--toutiao-->
    <script type="text/javascript">
        (function (root) {
            root._tt_config = true;
            var ta = document.createElement('script');
            ta.type = 'text/javascript';
            ta.async = true;
            ta.src = document.location.protocol + '//' + 's3.pstatp.com/bytecom/resource/track_log/src/toutiao-track-log.js';
            ta.onerror = function () {
                var request = new XMLHttpRequest();
                var web_url = window.encodeURIComponent(window.location.href);
                var js_url = ta.src;
                var url = '//ad.toutiao.com/link_monitor/cdn_failed?web_url=' + web_url + '&js_url=' + js_url + '&convert_id=61127803569';
                request.open('GET', url, true);
                request.send(null);
            }
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(ta, s);
        })(window);
    </script>

</head>
<body ontouchstart="">
<div class="page" style="padding-bottom:50px;">
    <div class="comm-pics">
        <!-- <div class="to_overflow" style="overflow: hidden;"> -->
        <div id="swip">
            <a href="javascript:;"><img data-src="Picture/15051828111320.jpg" src=""></a>
            <a href="javascript:;"><img data-src="Picture/14955882637371.jpg" src=""></a>
            <a href="javascript:;"><img data-src="Picture/14955882657419.jpg" src=""></a>
            <a href="javascript:;"><img data-src="Picture/14955903466812.jpg" src=""></a>
        </div>
        <div class="swip-nav"></div>
    </div>
    <script type="text/javascript">
        function echo_month(v) {
            // var unit = "20469"=="1171"?"盆":"束";
            // switch(v){
            // 	case "1个月":
            // 		document.write("1个月(4"+unit+")");
            // 		break;
            // 	case "3个月":
            // 		document.write("3个月(12"+unit+")");
            // 		break;
            // 	case "6个月":
            // 		document.write("6个月(24"+unit+")");
            // 		break;
            // 	case "12个月":
            // 		document.write("12个月(48"+unit+")");
            // 		break;
            // 	default:
            document.write(v);
            // 		break;
            // }
        }
    </script>
    <div class="produt-head-out">
        <div class="produt-head">
            <div class="produt-title">【11.11】繁花-混合鲜花包月套餐</div>
            <div class="produt-subtitle">新用户首单送JULY花瓶。多种花材，精心搭配，每周配送1次，每次1束，每月共4束。</div>
            <div class="produt-price">
                ￥<span>169-1988</span>
                <span class="del-price">价格￥211.25-3218.9</span>

            </div>
        </div>
        <!-- <ul class="sale_out">
            <li class="sale_title">促销：</li>
            <li><span class="sml_tit border1px">活动</span>芍药季订购3个月以上免费加送一次芍药，芍药季订购3个月以上免费加送一次芍药</li>
            <li><span class="sml_tit border1px">限制</span>此价格不与套装优惠同时享受</li>
        </ul> -->
    </div>
    <div class="pro-buy">产品信息<u class="jt"></u></div>

    <div class="line-l"></div>
    <div class="product-detail">
        <div class="new_title">产品详情:</div>
        <div id="desc" style="overflow: hidden;"></div>
        <div style="overflow: hidden">

            <div id="product-detail" style="text-align: center;background:#f5ecec"><img style="max-width:100%;margin-bottom:40px"
                                          src=""></div>
        </div>

    </div>
    <div class="buy-wrap borderTop">
        <a class="buy-tohome tBor" href="index.html"></a>
        <a href="javascript:void(0)" class="subscription">立即订阅</a>
    </div>
    <div class="flick-menu-mask"></div>
    <!-- 弹窗 -->
    <div class="alert-out">
        <form action="http://pay.yzztnet.com/public/api/index.php/flower/weixin_pay/wxpay" method="post" id="alerturl">
            <div class="alert" style="z-index:51">
                <div class="alert_top">
                    <dl class="flex">
                        <dt><img src="Picture/15051828111320.jpg" alt=""></dt>
                        <dd>
                            <p class="product-toptit" id="baoyuename" name="baoyuename">【11.11】繁花-混合鲜花包月套餐</p>
                            <div class="produt-price price2">
                                ￥<span id="price" name="price" attr="169-1988">169-1988</span>
                                <span class="del-price" id="before_price"
                                      attr="211.25-3218.9">价格￥211.25-3218.9</span><span
                                    style="color:grey;font-size: 12px;font-weight: 300;" id="diff_price"></span>
                                <!---->
                            </div>
                        </dd>
                    </dl>
                    <div class="alert_close"><span></span></div>
                </div>
                <div id="sku_content">
                    <dl class="sku-item">
                        <dt>订几个月:
                        <p style="color:#f6325b;margin-top:-8px;font-size:10px;"></p>
                        </dt>
                        <dd class="sever-time" sku-name="订几个月" data-key="0" style="padding: 0 2% 20px;">
                            <div id="sever-time">
                                <label><input name="time" type="radio" value="1个月(4束)" onclick="checkchoose(1,'f')"/>
                                    <script type="text/javascript">echo_month("1个月(4束)");</script>
                                </label>
                                <label><input name="time" type="radio" value="3个月(12束)" onclick="checkchoose(3,'f')"/>
                                    <script type="text/javascript">echo_month("3个月(12束)");</script>
                                </label>

                                <label><input name="time" type="radio" value="6个月(24束)" onclick="checkchoose(6,'f')"/>
                                    <script type="text/javascript">echo_month("6个月(24束)");</script>
                                </label>
                                <label><input name="time" type="radio" value="12个月(48束)"
                                              onclick="checkchoose(12,'f')"/>
                                    <script type="text/javascript">echo_month("12个月(48束)");</script>
                                </label>
                            </div>
                            <!-- <span data-key="0" class="border1pxgray"><script type="text/javascript">echo_month("1个月(4束)");</script></span>
                                             <span data-key="1" class="border1pxgray"><script type="text/javascript">echo_month("3个月(12束)");</script></span>
                                             <span data-key="2" class="border1pxgray"><script type="text/javascript">echo_month("6个月(24束)");</script></span>
                                             <span data-key="3" class="border1pxgray"><script type="text/javascript">echo_month("12个月(48束)");</script></span>-->

                        </dd>
                    </dl>

                    <!--<dl class="sku-item" style="Float:right;">
                        <dt>选择提货时间：</dt>
                        <dd style="width:180px;">&nbsp;&nbsp;
                            <label><input name="time" type="radio" value="星期一" /><script type="text/javascript">echo_month("星期一");</script> </label>&nbsp;&nbsp;
                            <label><input name="time" type="radio" value="星期五" /><script type="text/javascript">echo_month("星期五");</script> </label>
                        </dd>
                    </dl>-->
                    <dl class="sku-item" style="margin-top:-5px;">
                        <dt class="choiceTime" >选择提货时间：</dt>
                        <dd style="margin-top:16px;">
                            <label class="xqy"><input name="time2" type="radio" value="星期一"/>
                                <script type="text/javascript">echo_month("星期一");</script>
                            </label>
                            <label class="xqw"><input name="time2" type="radio" value="星期五"/>
                                <script type="text/javascript">echo_month("星期五");</script>
                            </label>
                        </dd>
                    </dl>
                    <dl class="sku-item" style="margin-top:32px;display: none;" id="didian1">
                        <dt >选择提货地点：</dt>
                        <dd style="margin-top:16px;"><select id="tihuodian" style="width:160px;height:25px">
                            <option value="上海">上海</option>
                            <option value="南京">南京</option>
                        </select></dd>
                    </dl>
                    <dl class="sku-item" style="margin-top:32px;display: none;" id="didian2">
                        <dt >填写提货信息：</dt>
                        <dd style="margin-left:10px;">邮寄地址地点:<input type="text" id="address" style="margin-left: 25px;" placeholder="请填入地址"></dd>
                        <dd style="margin-left:10px;">收件人手机号:<input type="text" id="phones" style="margin-left: 25px;" placeholder="请填入手机号"></dd>
                        <dd style="margin-left:10px;">收件人姓名:<input type="text" id="name" style="margin-left: 10px;" placeholder="请填入姓名"></dd>
                    </dl>
                  <dl class="sku-item" >
                        <dt>
                      <!--  <p style="color:#f6b232;margin-top:5px;font-size:10px;">银卡会员打95折，金卡会员打85折</p>-->
                        </dt>
                    </dl>
                    <!--  <dl class="sku-item">
          <dt>双十一超值赠送:
              <p style="color:#f6325b;margin-top:5px;font-size:10px;">随第一次收花配送，若赠品中含花剪及本子颜色随机</p>
          </dt>
      <dd sku-name="双十一超值赠送"  data-key="1">
                          <span data-key="0" class="border1pxgray"><script type="text/javascript">echo_month("保鲜液(5包)");</script></span>
                          <span data-key="1" class="border1pxgray"><script type="text/javascript">echo_month("花剪+保鲜液(16包)");</script></span>
                          <span data-key="2" class="border1pxgray"><script type="text/javascript">echo_month("花剪+保鲜液(34包)");</script></span>
                          <span data-key="3" class="border1pxgray"><script type="text/javascript">echo_month("花剪+保鲜液(72包)+环保袋+本子");</script></span>

          </dd>
          </dl>-->

                </div>


                <div class="option">
                    <a class="buy-submit " id="dingyue" href="javascript:void(0);">立即订阅</a>
                    <!-- <input type="submit" value="立即订阅" name="submitinfo" class="buy-submit">-->
                </div>
            </div>
        </form>

    </div>
    <script src="Scripts/details.js"></script>
    <script src="Scripts/pic_swip.js"></script>
    <!-- 弹窗 -->
    <script type="text/javascript">
        // 新加的
        $(".pro-buy,.subscription").click(function (event) {
            if ($('#product_num_input').val() > 0) {
                $('.minusBtn').removeClass('unclick');
            } else {
                $('.minusBtn').addClass('unclick');
            }
           // $(".flick-menu-mask").show();
            $(".flick-menu-mask,.alert").show();
            //$(".alert").show();
            $(".alert").addClass('spec-menu-show');
            $("body,html").css({"overflow": "hidden"});
        });
        $(".alert_close,.flick-menu-mask").click(function (event) {
            $(".alert").addClass('spec-menu-hide');
            $("body,html").css({"overflow": "visible"});
            setTimeout(function () {
                $(".flick-menu-mask,.alert").hide();
                $(".alert").removeClass('spec-menu-show');
                $(".alert").removeClass('spec-menu-hide');
            }, 300);
        });
        // 新加的
        var onloading = false;
        $(function () {
            $("#master_prize").on("click", function () {
                getprize();
            });
            var masterprize = localStorage.getItem('masterprize');
            if (masterprize > 0) {
                getprize();
                localStorage.removeItem('masterprize');
            }
        });
        function getprize() {
            if (onloading) {
                $.alert('请稍后再点击');
                return;
            }
            onloading = true;
            $.post('/activity/getmasterprize', function (v) {
                if (v.f) {
                    $.alert(v.data);
                    onloading = false;
                    return;
                } else {
                    if (v.data == '未登录') {
                        onloading = false;
                        var coupid = localStorage.setItem('masterprize', 1);
                        var url = window.location.href;
                        window.location.replace('/activity/login_activity?url=' + url);
                    } else {
                        $.alert(v.data);
                        onloading = false;
                        return;
                    }
                }
            }, "json");
        }
    </script>
    <script type="text/javascript">
        var test_remind = 0;
        if (test_remind == 1) {
            FP.showError("此商品当前处于测试阶段！");
        }
        FP.fastClick();
        $("#main_pic").css({
            "opacity": 0,
            "-webkit-transition": "opacity .3s linear 0s",
            "transition": "opacity .3s linear 0s"
        });
        $("#main_pic").bind("load", function () {
            $("#main_pic").css({
                "opacity": 1
            });
        });
        $("#main_pic").attr("src", $("#main_pic").attr("data-src"));
        $('#product_num_input').val(0);

        var data = {
            "status": "1",
            "can_yaoqing": 0,
            "can_credit": "1",
            "can_coupon": "0",
            "can_couponcode": "0",
            "can_share": "1",
            "can_onlynewcustomer": "0",
            "can_onlyone": "0",
            "can_cancel": "1",
            "can_edit": "1",
            "can_editads": "1",
            "can_zhufuka": "1",
            "can_notlike": "0",
            "can_fixed_delivery_date": 0,
            "can_daishoudian": 1,
            "price": "169-1988",
            "desc": [{
                "type": "html",
                "content": "<p><a href=\"http:\/\/static2.flowerplus.cn\/activity\/doubleone\" target=\"_self\"><img src=Picture/4b3b6a3b69714c8aba4d185ee7100a2a.gif"
            }]
        }
        ;
        var marketingid = "";
        var oid = "";
        var sku = [];
        var is_runing = false;
        var priceArr = [198, 188, 168, 128, 99];
        //data.price = 198;
        for (var i = 0; i < data.sku_item.length; i++) {
            sku.push(-1);
        }
        if (sku.length == 1) {
            initSkuSelect();
        }
        $(".sku-item span").on("click", function () {
            if ($(this).hasClass("disable")) {
                return;
            }
            $(this).siblings('span').removeClass('on');
            $(this).siblings('span').removeClass('border1px').addClass('border1pxgray');
            if ($(this).hasClass('border1px') || $(this).hasClass('on')) {
                $(this).removeClass('border1px').siblings('span');
                $(this).removeClass('on');
                $(this).addClass('border1pxgray');
            }
            else {
                $(this).removeClass('border1pxgray');
                $(this).addClass('on');
                $(this).addClass('border1px');
            }
            var data_key = parseInt($(this).parent().attr("data-key"));//位置
            sku[data_key] = parseInt($(this).attr("data-key"));//位置的选择
            var s = new Array();
            for (var i = 0; i < $('#sku_content').find('.sku-item').length; i++) {
                if (typeof($('#sku_content').find('.sku-item').eq(i).find('.on').attr('data-key')) == 'undefined') {
                    s[i] = -1;
                } else {
                    s[i] = $('#sku_content').find('.sku-item').eq(i).find('.on').attr('data-key');
                }
            }
//            console.log(s);
            if (s.length == 1) {
                initSkuSelect();
            } else {
                flushSkuSelect(s[0]);
            }
            // flushSkuStatus(data_key);
            updatePrice();
        });

        $('.selectBox .inlineBtn').on('click', function (e) {
            if ($(this).hasClass('unclick')) return;
            var val = $('#product_num_input').val();
            val = val ? parseInt(val) : 0;
            if ($(this).hasClass('addBtn')) {
                val++;
                $('#product_num_input').val(val);
                $('.minusBtn').removeClass('unclick');
            } else {
                val--;
                $('#product_num_input').val(val);
                if (val == 0) {
                    $('.minusBtn').addClass('unclick');
                }
            }
            calcuPrice(val);
        })
        $('#product_num_input').on('input change', function () {
            var val = $(this).val() ? $(this).val() : 0;
            calcuPrice(parseInt(val));
        })

        function calcuPrice(val) {
            if (val >= 5 && val < 10) {
                $('#discountPrice').text(val * (priceArr[0] - priceArr[1]));
                data.price = priceArr[1];
            } else if (val >= 10 && val < 100) {
                $('#discountPrice').text(val * (priceArr[0] - priceArr[2]));
                data.price = priceArr[2];
            } else if (val >= 100 && val < 500) {
                $('#discountPrice').text(val * (priceArr[0] - priceArr[3]));
                data.price = priceArr[3];
            } else if (val >= 500) {
                $('#discountPrice').text(val * (priceArr[0] - priceArr[4]));
                data.price = priceArr[4];
            } else {
                $('#discountPrice').text(0);
                data.price = priceArr[0];
            }
            $('#price').text(data.price);
            $('#goods_num').text(val);
            $('#realPayPrice').text(val * data.price);
        }

        //初始化第一个项目
        function initSkuSelect() {
            //去除disable
            $("span.disable").removeClass("disable");
            for (var skuname in data.sku) {
//                 console.log(skuname);
                if (typeof(data.sku[skuname]['select']) !== 'undefined') {
                    if (data.sku[skuname]['select'] == 1) {
                        var a = skuname.substr(1);
                        $("dd[data-key='0'] span").each(function () {
                            $(this).removeClass('on');
                            if ($(this).attr('data-key') == a) {
                                $(this).siblings('span').removeClass('on').removeClass('border1px').addClass('border1pxgray');
                                $(this).addClass('on').removeClass('border1pxgray').addClass('border1px');
                            }
                        });
                    }
                }
                ;
                if (typeof(data.sku[skuname]['disable']) !== 'undefined') {
                    if (data.sku[skuname]['disable'] == 1) {
                        var a = skuname.substr(1);
                        $("dd[data-key='0'] span").each(function () {
                            if ($(this).attr('data-key') == a) {
                                $(this).removeClass('on');
                                $(this).addClass('disable');
                                $(this).removeClass('border1px').addClass('border1pxgray')
                            }
                        });
                    }
                }
                ;
            }
        }
        //必选的给他选上
        function flushSkuSelect(num) {
            //去除disable
            $("span.disable").removeClass("disable");
            //只有第一个的时候给他加上后面的select
            for (var skuname in data.sku) {
//                 console.log(skuname);
                if (skuname.substr(1, 1) == num) {
                    if (typeof(data.sku[skuname]['select']) !== 'undefined') {
                        if (data.sku[skuname]['select'] == 1) {
                            var a = skuname.substr(1).split('_');
                            for (var i = 0; i < a.length; i++) {
                                if (a[i] !== '-1') {
                                    $("dd[data-key='" + i + "'] span").each(function () {
                                        $(this).removeClass('on').removeClass('border1px').addClass('border1pxgray');
                                        if ($(this).attr('data-key') == a[i]) {
                                            $(this).addClass('on').removeClass('border1pxgray').addClass('border1px');
                                        }
                                    });
                                }
                            }
                        }
                    }
                    ;
                }
                if (skuname.substr(1, 1) == num) {
                    if (typeof(data.sku[skuname]['disable']) !== 'undefined') {
                        if (data.sku[skuname]['disable'] == 1) {
                            var a = skuname.substr(1).split('_');
                            for (var i = 1; i < a.length; i++) {
                                // console.log(a[i]);
                                if (a[i] !== '-1') {
                                    $("dd[data-key='" + i + "'] span").each(function () {

                                        if ($(this).attr('data-key') == a[i]) {
                                            $(this).removeClass('on');
                                            $(this).addClass('disable');
                                            $(this).removeClass('border1px').addClass('border1pxgray')
                                        }
                                    });
                                }
                            }
                        }
                    }
                    ;
                }
            }
        }
        function updatePrice() {

            var s = new Array();
            for (var i = 0; i < $('#sku_content').find('.sku-item').length; i++) {
                if (typeof($('#sku_content').find('.sku-item').eq(i).find('.on').attr('data-key')) == 'undefined') {
                    s[i] = -1;
                } else {
                    s[i] = $('#sku_content').find('.sku-item').eq(i).find('.on').attr('data-key');
                }
            }
            // if(data.can_notselect != 1){
            // 	for(var i=0;i<s.length;i++){
            // 		if(s[i]<0){
            // 			return;
            // 		}
            // 	}
            // }
            // if(s[0] < 0){
            // 	return;
            // }
            var sku_id = 'i' + s.join("_");
//            console.log(sku_id);
            // var sku_id='i'+sku.join("_");
            if (s[0] == -1) {
                $("#price").html($('#price').attr('attr'));
                $("#before_price").html($('#before_price').attr('attr'));
                $("#diff_price").html('');
            } else {
                var sku_item = data.sku[sku_id];
                $("#price").html(sku_item.price);
                if (sku_item.before_price == sku_item.price) {
                    $("#before_price").html('');
                    $("#diff_price").html('');
                } else {
                    $("#before_price").html('价格￥' + sku_item.before_price);
                    $("#diff_price").html(',省' + (sku_item.before_price - sku_item.price).toFixed(1) + '元');
                }
            }


        }

        function flushSkuStatus(select_index, second) {
            var patten = "";
            for (var i = 0; i < sku.length; i++) {
                if (sku[i] >= 0) {
                    patten += sku[i].toString() + "_";
                } else {
                    patten += "\\d+_";
                }
            }
            patten = "^i" + patten.slice(0, -1) + "$";
            var reg = new RegExp(patten);
            var skuvalues = [];
            for (var i = 0; i < data.sku_item.length; i++) {
                skuvalues.push([]);
            }

            var isEmpty = true;
            for (var skuname in data.sku) {
                if (!reg.test(skuname)) {
                    continue;
                }

                if (typeof data.sku[skuname].disable == "number" || data.sku[skuname].disable == 1) {
                    continue;
                }

                var a = skuname.substring(1).split("_");
                for (var i = 0; i < a.length; i++) {
                    if (skuvalues[i].indexOf(a[i]) < 0) {
                        skuvalues[i].push(a[i]);
                        isEmpty = false;
                    }
                }

            }
            if (isEmpty && !second) {
                for (var j = 0; j < sku.length; j++) {
                    if (j != select_index) {
                        sku[j] = -1;
                        $("dd[data-key='" + j + "'] span").removeClass("on");
                    }
                }
                return flushSkuStatus(select_index, true);

            }

            $("span.disable").removeClass("disable");
            for (var i = 0; i < skuvalues.length; i++) {
                if (sku[i] > -1) {
                    continue;
                }
                $("dd[data-key='" + i + "'] span").each(function () {
                    if (skuvalues[i].indexOf($(this).attr("data-key")) < 0) {
                        $(this).addClass("disable");
                    }
                });
            }
        }

        if (data.sku_item.length == 1 && data.sku_item[0].item.length == 1) {
            sku = [0];
        }

        $(".buy-submit").on("click", function (e) {
            e.preventDefault();
            if (is_runing) {
                return;
            }
            if (data.status != 1) {
                FP.showError("已下架");
                return;
            }
            if ($(this).hasClass("buy-submit-disabled")) {
                FP.showError("已下架");
                return;
            }
            if (data.pro_type == 1) {
                FP.showError("此商品属于团购,请从团购页面下单");
                return;
            }
            if ($('#product_num_input').length > 0 && $('#product_num_input').val() == '0') return;
            var s = new Array();
            for (var i = 0; i < $('#sku_content').find('.sku-item').length; i++) {
                if (typeof($('#sku_content').find('.sku-item').eq(i).find('.on').attr('data-key')) == 'undefined') {
                    s[i] = -1;
                } else {
                    s[i] = $('#sku_content').find('.sku-item').eq(i).find('.on').attr('data-key');
                }
            }
//             console.log(s);
            for (var i = 0; i < s.length; i++) {
                if (s[i] < 0) {

                    if (data.sku_item[i].required != false) {
                        var item = true;
                        $('#sku_content').find('.sku-item').eq(i).find('span').each(function () {
                            if ($(this).hasClass('disable')) {

                            } else {
                                item = false;
                            }
                        });
                        if (!item) {
                            FP.showError("请选择\"" + data.sku_item[i].name + "\"");
                            //$("html,body").animate({scrollTop:$(".produt-head").offset().top}, 500);
                            $("html,body").scrollTop($(".produt-head").offset().top);
                            return;
                        }
                    }
                }
            }
            var num = s[0];
            var go_select = false;
            for (var skuname in data.sku) {
                if (skuname.substr(1, 1) == num) {
                    if (typeof(data.sku[skuname]['select']) !== 'undefined') {
                        if (data.sku[skuname]['select'] == 1) {
                            var a = skuname.substr(1).split('_');
                            for (var i = 0; i < a.length; i++) {
                                if (a[i] !== '-1') {
                                    $("dd[data-key='" + i + "'] span").each(function () {
                                        if ($(this).attr('data-key') == a[i]) {
                                            if ($(this).hasClass('on')) {

                                            } else {
                                                FP.showError("请选择\"" + data.sku_item[i].item[a[i]] + "\"");
                                                go_select = true;
                                            }
                                            ;
                                        }
                                    });
                                }
                            }
                        }
                    }
                    ;
                }
            }
            if (go_select) {
                return;
            }
            is_runing = true;
            var btn = $(this);
            var btn_text = btn.html();
            btn.html('请求中...').addClass('buy-submit-sending');


            var _submit = function () {
                var sku_id = data.id + 'i' + s.join("_");
                var inputs = [];
                var is_test = 0;
                if (data.id == 20316) {
                    var sku_id = data.id + 'i' + 0;
                    inputs.push($("<input>", {name: "num", value: $('#product_num_input').val()}));
                }
                inputs.push($("<input>", {name: "sku", value: sku_id}));
                if (marketingid.length > 0) {
                    inputs.push($("<input>", {name: "marketingid", value: marketingid}));
                }
                if (oid.length > 0) {
                    inputs.push($("<input>", {name: "oid", value: oid}));
                }
                inputs.push($("<input>", {name: "_t", value: (new Date().getTime())}));
                if (is_test == 1) {
                    inputs.push($("<input>", {name: "is_test", value: is_test}));
                }
                setTimeout(function () {
                    is_runing = false;
                    btn.html(btn_text).removeClass('buy-submit-sending');
                    FP.setAjaxTimeout(0);
                }, 300);
                $("<form>", {
                    method: "get",
                    action: _web_base + "buy/confirm"
                }).append(inputs).appendTo("body").css({opacity: 0}).submit();
            }
            if (3 == new Date().getDay()) {
                _submit();
            } else {
                FP.setAjaxTimeout(3000);
                FP.ajaxPost(
                        _web_base + "product/productstatus/",
                        {id: data.id},
                        function (v) {
                            if (v.f) {
                                _submit();
                            } else {
                                FP.showError(v.data);
                                is_runing = false;
                                btn.html(btn_text).removeClass('buy-submit-sending');
                                FP.setAjaxTimeout(0);
                            }
                        },
                        function () {
                            _submit();
                        }
                );
            }

            ga_buy();

            return;
        });


        var _imgs = [], loaded = 0;
        function loadDesc() {
            var desc = $("<div>");
            for (var i = 0; i < data.desc.length; i++) {
                var item = data.desc[i];
                switch (item['type']) {
                    case "html":
                        desc.append("<div class=\"product-detail-html\">" + item.content + "</div>");
                        break;
                    case "image":
                        desc.append("<img class=Picture/4b3b6a3b69714c8aba4d185ee7100a2a.gif"
                        product - detail - image\" width=\"100%\" style=\"height:300px;opacity:0\" src=\"\" data-src=\"" + item.content + "\"/>"
                    )
                        ;
                        break;
                }

            }
            $("#desc").append(desc);

            $(".product-detail-image").each(function () {
                _imgs.push($(this));
            });
            $(".product-detail-html p").each(function (index) {
                var num = $(this).find("img").length;
                var width = 100 / num + "%";
                ;
                $(this).find("img").css({
                    width: width,
                    height: width,
                    float: "left"
                });
                $(this).find("video").css({
                    width: "100%",
                    height: "100%",
                    float: "left",
                });
            })
        }

        $(function () {
            loadDesc();
            document.title = data.title;
            if (data.can_share == 0) {
                FP.hideAllNonBaseMenuItem();
            } else {
                FP.setWeixinShareTitle({
                    title: data.title + " - FLŌWERPLUS（花+）",
                    subtitle: data.subtitle,
                    image: data.image_64,
                    link: window.location.href
                });
            }

            $marks = /marketingid=(\d+)/.exec(window.location.search);
            if ($marks != null) {
                marketingid = $marks[1];
            }

        });
        $(window).bind("scroll", function () {
            if (_imgs.length == 0) {
                return;
            }
            var top = $(document).scrollTop();
            var bottom = top + $(window).height() + 300;
            for (var i = 0; i < _imgs.length; i++) {
                if (_imgs[i].offset().top < bottom) {
                    if (_imgs[i].attr("src") == "") {
                        _imgs[i].attr("src", _imgs[i].attr("data-src") + "!60").css({height: 'auto', opacity: 1});
                        loaded++;
                    }
                }
            }
            if (loaded == _imgs.length) {
                _imgs = [];
            }
        })

    </script>
    <!-- 2017-10-26 19:19:06 -->

</div>

<script>
    var page_type = 'product';
    var sat = 'cb037e036c03aad3';
    var sap = 'default';
    var sau = 'https://flowerplus.cloud.sensorsdata.cn:4006/sa?token=' + sat + '&project=' + sap;
    (function (para) {
        var p = para.sdk_url, n = para.name, w = window, d = document, s = 'script', x = null, y = null;
        w['sensorsDataAnalytic201505'] = n;
        w[n] = w[n] || function (a) {
                    return function () {
                        (w[n]._q = w[n]._q || []).push([a, arguments]);
                    }
                };
        var ifs = ['track', 'quick', 'register', 'registerPage', 'registerOnce', 'clearAllRegister', 'trackSignup', 'trackAbtest', 'setProfile', 'setOnceProfile', 'appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify', 'login', 'logout', 'trackLink', 'clearAllRegister'];
        for (var i = 0; i < ifs.length; i++) {
            w[n][ifs[i]] = w[n].call(null, ifs[i]);
        }
        if (!w[n]._t) {
            x = d.createElement(s), y = d.getElementsByTagName(s)[0];
            x.async = 1;
            x.src = p;
            y.parentNode.insertBefore(x, y);
            w[n].para = para;
        }
    })({
        sdk_url: '//static2.flowerplus.cn/Static/js/sa/sensorsdata.min.js?_t=20170807',
        name: 'sa',
        web_url: 'https://flowerplus.cloud.sensorsdata.cn/',
        server_url: sau,
        heatmap: {
            isTrackLink: false,
            //设置成 true 后，我们会自动给 a 标签绑定一个 sa.trackLink() 方法（详见本页 3.3 ），如果是单页面 a 标签不涉及页面跳转或者 a 标签的点击是下载功能，建议不要打开。默认 false 。
            loadTimeout: 1000,
            //设置多少毫秒后开始渲染点击图
            collect_url: function () {
                // 限制只采集微信端
                // && location.pathname.match(/^(\/)$|^(\/my\/?)$/g) !== null
                if (location.hostname === 't.flowerplus.cn' || location.hostname === 'static2.flowerplus.cn') {
                    return true;
                }
            }
            //返回true会采集当前页面的数据，返回false等假值表示不采集当前页面,设置这个函数后，内容为空的话，默认是返回假的。不写这个函数，默认是采集所有页面。
        }
        ,
        // debug_mode:true,
        debug_mode_upload: true
    });


    sa.quick('autoTrackWithoutProfile', {pageType: 'product', productId: 20469, orderType: 2});
</script>


<script type="text/javascript" src="Scripts/fpa.channel.js"></script>
<script>
    var fp_utm_source = getQueryString('utm_source');
    if (fp_utm_source != '' && fp_utm_source != null) {
        setCookie('fpa_channel_utm_source', fp_utm_source, null, '/', '.flowerplus.cn');
    }
</script>

<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?deb1341df19187ec5a232b519d62c8a9";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
<script>
    (function (i, s, o, g, r, a, m) {
        i['GoogleAnalyticsObject'] = r;
        i[r] = i[r] || function () {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
        a = s.createElement(o),
                m = s.getElementsByTagName(o)[0];
        a.async = 1;
        a.src = g;
        m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
    ga('create', 'UA-93082500-1', 'auto');
    ga('send', 'pageview');
</script>
<script>
    function exist_ga() {
        return typeof ga == 'function';
    }
    function ga_buy() {
        if (!exist_ga())return;
        ga("send", {hitType: "event", eventCategory: "订购流程", eventAction: "立即购买", eventLabel: "详情页购买"})
    }
    function ga_submit() {
        if (!exist_ga())return;
        ga("send", {hitType: "event", eventCategory: "订购流程", eventAction: "确认下单", eventLabel: "订单填写页"})
    }
    function ga_cancel() {
        if (!exist_ga())return;
        ga("send", {hitType: "event", eventCategory: "订购流程", eventAction: "取消订单", eventLabel: "订单确认页"})
    }
    function ga_pay(id, product_name, payment) {
        if (!exist_ga())return;
        ga("send", {hitType: "event", eventCategory: "订购流程", eventAction: "去支付", eventLabel: "订单确认页"});
        ga("require", "ecommerce");
        ga("ecommerce:addTransaction", {"id": id, "affiliation": product_name, "revenue": payment,});
        ga("ecommerce:send")
    }
    ;
</script>
<script type="text/javascript" src="Scripts/loghub-tracking.js"></script>
<script type="text/javascript">

    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)return unescape(r[2]);
        return null;
    }

    function getCookie(c_name) {
        if (document.cookie.length > 0) {
            c_start = document.cookie.indexOf(c_name + "=")
            if (c_start != -1) {
                c_start = c_start + c_name.length + 1
                c_end = document.cookie.indexOf(";", c_start)
                if (c_end == -1) c_end = document.cookie.length
                return unescape(document.cookie.substring(c_start, c_end))
            }
        }
        return ""
    }

    function UUID() {
        var d = new Date().getTime();
        var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = (d + Math.random() * 16) % 16 | 0;
            d = Math.floor(d / 16);
            return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
        });
        return uuid;
    }
    ;
    function getUUID() {
        var uuid = getCookie('loghub_uuid');
        if (!uuid) {
            uuid = UUID();
            var expire = new Date((new Date()).getTime() + 365 * 24 * 3600000);
            var domain = window.location.host;
            if (/^(www\.|t\.|m\.)flowerplus\.cn$/.test(domain)) {
                domain = '.flowerplus.cn';
            }
            document.cookie = 'loghub_uuid=' + escape(uuid) + ";path=/;domain=" + domain + ";expires=" + expire.toGMTString();
        }

        return uuid;
    }
    var logger = new window.Tracker('cn-hangzhou.log.aliyuncs.com', 'fp-web', 'fp-web-pv');
    logger.push('uuid', getUUID());
    logger.push('type', 'pv');
    logger.push('url', window.location.href);
    logger.push('referrer', document.referrer);
    logger.push('useragent', navigator.userAgent);
    logger.push('s', GetQueryString('s'));
    logger.push('marketingid', GetQueryString('marketingid'));

    logger.logger();
</script>

</body>

</html>